package ru.mipt.rt.konig.clusterjms;

import javax.naming.Context;
import javax.naming.NamingException;

/**
 * @author Pavel G. Belevich
 *         Date: 01.11.2010
 *         Time: 2:21:37
 */
public class Main {

    public static void main(String[] args) throws NamingException {
//        Context ctx = null;
//        Hashtable ht = new Hashtable();
//        ht.put(Context.INITIAL_CONTEXT_FACTORY,
//                "weblogic.jndi.WLInitialContextFactory");
//        ht.put(Context.PROVIDER_URL,
//                "t3://vanbook:7001,vanbook:7003,vanbook:7004");
//
//        try {
//            ctx = new InitialContext(ht);
//            System.out.println("");
//            // Use the context in your program
//        }
//        catch (NamingException e) {
//            e.printStackTrace();
//            // a failure occurred
//        }
//        finally {
//            try {
//                ctx.close();
//            }
//            catch (Exception e) {
//                e.printStackTrace();
//                // a failure occurred
//            }
//        }
        weblogic.jndi.Environment environment = new weblogic.jndi.Environment();
        environment.setInitialContextFactory(
                weblogic.jndi.Environment.DEFAULT_INITIAL_CONTEXT_FACTORY);
        environment.setProviderURL("t3://vanbook:7001");
        Context ctx = environment.getInitialContext();
        System.out.println("");
    }

}
